package com.mg.framework.kernel;

import java.util.HashMap;
import java.util.Map;

import android.graphics.Bitmap;

public abstract class ComplexActor extends Actor {

	protected Map<String, ActorComponent> actorComponents = null;
	

	public ComplexActor(Screen screen, Bitmap bitmap) {
		super(screen, bitmap);
		initCanvasComponents();
	}

	public ComplexActor(Screen screen, int width, int height) {
		super(screen, width, height);
		initCanvasComponents();
	}

	private void initCanvasComponents() {
		this.actorComponents = new HashMap<String, ActorComponent>();
	}

	protected void addComponent(String componentName,
			ActorComponent actorComponent) {
		this.actorComponents.put(componentName, actorComponent);
	}

	protected ActorComponent getComponent(String componentName) {
		return this.actorComponents.get(componentName);
	}
}
